﻿<UserControl x:Class="GeoFinderClientApp.View.UserControls.PushSettingsControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:tk="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:converters="clr-namespace:GeoFinderClientApp.Converters"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">

    <UserControl.Resources>

        <converters:BoolBrushConverter x:Key="BoolBrushConverter" />

        <Style x:Key="DescTextStyle" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
            <Setter Property="FontSize" Value="18" />
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
            <Setter Property="TextWrapping" Value="Wrap" />
            <Setter Property="Margin" Value="16,-38,16,24" />
        </Style>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}">

        <StackPanel>
            <StackPanel>
                <tk:ToggleSwitch Header="Push Notifications" FontSize="22"
                                 IsChecked="{Binding IsPushEnabled, Mode=TwoWay}" Name="PushEnabled" />
                <TextBlock Style="{StaticResource DescTextStyle}"
                           Text="Turn on/off push notifications." />
            </StackPanel>

            <Grid>
                <StackPanel Margin="16,0,0,0">
                    <tk:ToggleSwitch Header="Tile Notifications" Name="TileEnabled"
                                 IsChecked="{Binding IsTileEnabled, Mode=TwoWay}" />
                    <TextBlock Style="{StaticResource DescTextStyle}"
                           Text="Tile push notifications update the application's tile displayed in the Start Screen. The application must be pinned by the user first." />

                    <tk:ToggleSwitch Header="Toast Notifications" Name="ToastEnabled"
                                 IsChecked="{Binding IsToastEnabled, Mode=TwoWay}" />
                    <TextBlock Style="{StaticResource DescTextStyle}"
                           Text="Toast push notifications are system-wide notifications that do not disrupt the user workflow or require intervention to resolve and are displayed in the top of the screen for ten seconds." />

                    <tk:ToggleSwitch Header="Raw Notifications" Name="RawEnabled"
                                 IsChecked="{Binding IsRawEnabled, Mode=TwoWay}" />
                    <TextBlock Style="{StaticResource DescTextStyle}"
                           Text="Raw push notifications are used to send application specific information. The application must be running first." />
                </StackPanel>

                <Border Background="{Binding IsPushEnabled, Converter={StaticResource BoolBrushConverter}}" />
            </Grid>

        </StackPanel>
    </Grid>
</UserControl>
